<?php
/**
 * Created by Benjiemin
 * Date: 2020/2/26
 * Time: 16:45
 */
require ('./vendor/autoload.php');
require ('./aip-php-sdk-2.2.15\AipOcr.php');

use QL\QueryList;
use QL\Ext\Chrome;


$ql = QueryList::getInstance();
// 注册插件，默认注册的方法名为: chrome
$ql->use(Chrome::class);
$text = $ql->chrome(function ($page,$browser) {

    $username = 'benjiemin';
    $password = '123456';
    $page->goto('http://106.52.105.157:1001/#/LoginRegister');
    sleep(3);
    // 这里故意设置一个很长的延长时间，让你可以看到chrome浏览器的启动
    $page->type("div .nickName input",$username);
    $page->type("div .password input",$password);
   sleep(5);
    $page->click("div .submit");
    sleep(5);
    $html = $page->content();
    sleep(3);
    //进入投注界面
    $page->goto('http://106.52.105.157:1001/#/Mine');
    sleep(5);
    //选择北京赛车
    $page->click("input #bST_4");
    sleep(5);
  // $browser->close();
    // 返回值一定要是页面的HTML内容
    return $html;
},[
    'headless' => false, // 启动可视化Chrome浏览器,方便调试
    'devtools' => false, // 打开浏览器的开发者工具
])->find('title')->text();
